package com.briup.corejava.chap11.bean;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

public class Student implements Serializable {
    // 手动提供serialVersionUID的值
    @Serial
    private static final long serialVersionUID = 1L;
    private String name;
    // transient 短暂的、转瞬即逝的，值不会被序列化
    private /*transient*/ int age;
    // 序列化成功之后，补充一个变量
    private String password;

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", password='" + password + '\'' +
                '}';
    }
}
